package com.xn.app.muying.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.LinearLayout;

import com.xn.app.muying.R;
import com.xn.app.muying.fragment.MonitorFragment;

/**
 * Created by Administrator on 2016/10/18.
 */
public class MonitorActivity extends AppCompatActivity{
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.monitor_activtiy);
        LinearLayout ll = (LinearLayout) findViewById(R.id.monitor_activity_ll);
        MonitorFragment reMenFragment = new MonitorFragment();
        topass(reMenFragment);

    }
    public void topass(Fragment fragment) {
        FragmentManager fm = getSupportFragmentManager();
        FragmentTransaction ft = fm.beginTransaction();
        ft.replace(R.id.monitor_activity_ll, fragment);
        ft.commitAllowingStateLoss();
    }
}
